//
//  UIBARButtonItem+Extension.swift
//  新浪微博
//
//  Created by 王之皆 on 17/1/7.
//  Copyright © 2017年 北京海狸先生网络科技有限公司. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    
    /// 创建 UIBarButtonItem
    ///
    /// - parameter title:    <#title description#>
    /// - parameter fontSize: <#fontSize description#>
    /// - parameter target:   <#target description#>
    /// - parameter action:   <#action description#>
    ///
    /// - returns: <#return value description#>
    convenience init(title:String,fontSize: CGFloat = 16,target: Any, action:Selector,isBack: Bool = false) {
        let btn = UIButton(frame: CGRect(x: 0.0, y: 0.0, width: 50, height: 50), title: title, defualColor: UIColor.darkGray, highlightedColor: UIColor.orange,fontSize:fontSize)
        
        if isBack {
             btn.setImage(UIImage(named: "hr_back"), for: .normal)
        }
        btn.sizeToFit()
            btn.addTarget(target, action: action , for: .touchUpInside)
        self.init(customView: btn)
    }

}














































































